//
// GPSMapEdit
// (c) Konstantin Galichsky (kg@geopainting.com), 2004-2007
//
// The RUSSA-specific type set.
//

# include "StdAfx.h"
# include "Resource.h"
# include "RussaTypes.h"
# include "NavitelTypes.h"
# include "GarminTypes.h"
# include "GarminRound.h"
# include "Map.h"
# include "TypesDraw.h"
# include "TypesPOIDraw.h"
# include "Globals.h"

static std::vector<type_desc_t> g_types_impl;

static
void _InitRussaTypes () {
	InitNavitelTypes (g_types_impl);

	// NOTE: here is assumed that STL stores vector as plain array.
	g_tsRussa.pTypes           = & g_types_impl [0];
	g_tsRussa.cTypes           = g_types_impl.size ();

	g_tsRussa.strID            = "Russa";
	g_tsRussa.strDisplayName   = "RUSSA";

	g_tsRussa.pfGetLatGrid     = GarminLatGrid;
	g_tsRussa.pfRoundPoint     = GarminRoundPoint;
	g_tsRussa.pfRoundPoints    = GarminRoundPoints;
	g_tsRussa.pfRoundRect      = GarminRoundRect;

	g_tsRussa.pfIsCity         = Garmin_IsCity;
	g_tsRussa.pfIsHeight       = Garmin_IsHeight;
	g_tsRussa.pfIsFeature      = Garmin_IsFeature;
	g_tsRussa.pfIsRoad         = Navitel_IsRoad;
	g_tsRussa.pfIsUnpavedRoad  = Navitel_IsUnpavedRoad;
	g_tsRussa.pfIsHwExit       = RgnPredicateFalse;
	g_tsRussa.pfIsBackground   = Garmin_IsBackground;
	g_tsRussa.pfHasAddress     = RgnPredicateTrue;
	g_tsRussa.pfHasCityAndZip  = RgnPredicateTrue;
	g_tsRussa.pfHasPhone       = RgnPredicateFalse;
	g_tsRussa.pfHasContact     = RgnPredicateFalse;
	g_tsRussa.pfHasDescription = RgnPredicateFalse;

	g_tsRussa.dwFeatures       = CTypeSet::tsfHasCopyright | CTypeSet::tsfHasElevationUnits;

	g_tsRussa.cMaxBits         = 26;
}

static
void _DestroyRussaTypes () {}

CTypeSet g_tsRussa (_InitRussaTypes, _DestroyRussaTypes);

/////////////////////////////////////////////////////////////////////

USHORT ConvertTypeSet_Garmin2Russa (RGN_KIND _Kind, USHORT _ushType) {
	return _ushType;
}

DECLARE_TYPESET_CONVERTOR (ConvertTypeSet_Garmin2Russa, & g_tsGarmin, & g_tsRussa);

USHORT ConvertTypeSet_Russa2Garmin (RGN_KIND _Kind, USHORT _ushType) {
	return ConvertTypeSet_Navitel2Garmin (_Kind, _ushType);
}

DECLARE_TYPESET_CONVERTOR (ConvertTypeSet_Russa2Garmin, & g_tsRussa, & g_tsGarmin);

USHORT ConvertTypeSet_Russa2Navitel (RGN_KIND _Kind, USHORT _ushType) {
	return _ushType;
}

DECLARE_TYPESET_CONVERTOR (ConvertTypeSet_Russa2Navitel, & g_tsRussa, & g_tsNavitel);